package com.api.equipment.factory;

import com.api.equipment.RemoteEquipmentService;
import com.api.equipment.domain.LgEquipmentError;
import com.api.equipment.domain.LgMachine;
import com.api.equipment.domain.LgTemperature;
import com.api.equipment.domain.LgVehicle;
import com.ruoyi.common.core.web.domain.AjaxResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 用户服务降级处理
 *
 * @author ruoyi
 */
@Component
public class RemoteEquipmentFallbackFactory implements FallbackFactory<RemoteEquipmentService>
{
    private static final Logger log = LoggerFactory.getLogger(RemoteEquipmentFallbackFactory.class);

    @Override
    public RemoteEquipmentService create(Throwable throwable)
    {
        log.error("用户服务调用失败:{}", throwable.getMessage());
        return new RemoteEquipmentService()
        {
            @Override
            public List<LgTemperature> list1() {
                System.out.println("调用失败");
                return null;
            }

            @Override
            public int setTem(LgTemperature lgTemperature) {
                return 0;
            }

            @Override
            public List<LgVehicle> selectLgVehicleList(LgVehicle lgVehicle) {
                System.out.println("调用失败");
                return null;
            }

            @Override
            public int edit(LgEquipmentError lgEquipmentError) {
                return 0;
            }

            @Override
            public List<LgEquipmentError> list(LgEquipmentError lgEquipmentError) {
                return null;
            }

            @Override
            public AjaxResult insertOrderLocation() {
                return null;
            }

            @Override
            public LgTemperature selectLgVehicleBylicensePlate(String licensePlate) {
                return null;
            }

            @Override
            public List<LgMachine> list(LgMachine lgMachine) {
                return null;
            }

            @Override
            public LgMachine getInfo(String id) {
                return null;
            }

            @Override
            public int update(LgMachine lgMachine) {
                return 0;
            }

            @Override
            public LgTemperature getTemInfo(Integer id) {
                return null;
            }

            @Override
            public LgEquipmentError getEquipError(Integer deviceNumber) {
                return null;
            }

            @Override
            public int insertEquipError(LgEquipmentError lgEquipmentError) {
                return 0;
            }


        };
    }
}
